home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8869 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  714 b 

  1. From: LittleGuyRascal@msn.com (Gregory Saxton)
  2. Subject: RE: Help!   C++ undef array problem
  3. Date: 27 Feb 96 02:43:50 -0800
  4. References: <4gnrm0$gcq@vista.hevanet.com>
  5. Message-ID: <00001a81+0000a888@msn.com>
  6. Path: news.msn.com!msn.com
  7. Newsgroups: comp.lang.c++
  8. Organization: The Microsoft Network (msn.com)
  9.  
  10. In a nutshell no, 'n' will not be passed because bx is an automatic 
  11. variable class member.  If you change bx to be int * bx; and allocate 
  12. the array in your constructor you it will work.
  13.  
  14. Sea::Sea(HINSTANCE hInst, char far* name, int n)
  15. {
  16.     //
  17.     // Try this - and remove the private automatic declaration of bx[n] 
  18. from the class.
  19.     //
  20.     bx = new int[n];
  21.  
  22.      for(int i=1;i<=n;i++)  {
  23.     bx[i]= 3            }
  24. }
  25.